import request from "@/utils/request";
// 接单管理的所有接口
export function orderReceive_List(query) {
  return request({
    url: "/goods/order/list",
    method: "get",
    params: query
  });
}
export function orderReceive_List1(query) {
  return request({
    url: "/goods/order/teacher/list",
    method: "get",
    params: query
  });
}
export function addOrder (data) {
  return request({
    url: "/goods/order",
    method: "post",
    data: data
  })
}
export function updateOrder(data) {
  return request({
    url: "/goods/order",
    method: "put",
    data: data
  });
}
export function delOrder(id) {
  return request({
    url: `/goods/order/${id}`,
    method: "delete"
  });
}

// 指派老师
export function checkTeacher (data) {
  return request({
    url: '/goods/order/assigned/teacher',
    method: 'get',
    params: data
  })
}

// 老师审批材料
export function checkMaterial (data) {
  return request({
    url: '/goods/order/material/state',
    method: 'get',
    params: data
  })
}


// 老师审批记录
export function record (id) {
  return request({
    url: `/goods/examine/list?orderId=${id}`,
    method: 'get'
  })
}
// 多图片上传自定义
export function uploadProductImg(data) {
  return request({
    url: "upload/file",
    method: "post",
    data: data
  })
}


// 查询已上传材料
export function getMaterial (data) {
  return request({
    url: '/goods/file/list',
    method: 'get',
    params: data
  })
}
export function addMaterial (data) {
  return request({
    url: '/goods/file',
    method: 'post',
    data: data
  })
}
export function updateMaterial (data) {
  return request({
    url: '/goods/file',
    method: 'put',
    data: data
  })
}

// 流程管理
export function queryProcess(data) {
  return request({
    url: "/goods/flow/list",
    method: "get",
    params: data
  });
}
export function addProcess(data) {
  return request({
    url: "/goods/flow",
    method: "post",
    data: data
  })
}
export function updateProcess(data) {
  return request({
    url: "/goods/flow/website",
    method: "put",
    data: data
  });
}
export function updateProcess1(data) {
  return request({
    url: "/goods/flow",
    method: "put",
    data: data
  });
}


// 机构查询订单接口
export function fetchOrder_org (data) {
  return request({
    url: '/goods/order/org/list',
    method: 'get',
    params: data
  })
}

// 招商部查询订单接口
export function fetchOrder_pt (data) {
  return request({
    url: '/goods/order/att/list',
    method: 'get',
    params: data
  })
}

// 终端查询订单接口
export function fetchOrder_user (data) {
  return request({
    url: '/goods/order/other/list',
    method: 'get',
    params: data
  })
}



export function orderPay (id) {
  return request({
    url: `/goods/order/pay/`+id,
    method: 'get',
    responseType: 'blob' 
  })
}
export function attribute(data) {
  return request({
    url:'goods/attribute/list',
    method:'get',
    params:data
  })
}